package com.sxt.permissionsdispatcher_processor.permissiondispatchercompiler;

import org.jetbrains.annotations.NotNull;

import javax.lang.model.element.Element;
import javax.lang.model.element.ElementKind;
import javax.lang.model.element.Modifier;
import javax.lang.model.element.TypeElement;

public class ClassValidator {

    public static boolean isPrivate(Element element) {
        return element.getModifiers().contains(Modifier.PRIVATE);
    }

    public static boolean isAbstract(Element element) {
        return element.getModifiers().contains(Modifier.ABSTRACT);
    }

    @NotNull
    public static String getClassName(@NotNull TypeElement typeElement, @NotNull String packageName) {
        int packageLen = packageName.length();
        return typeElement.getQualifiedName().toString().substring(packageLen + 1);
    }
}
